package org.sn.jdish.designmode.singleton;

public class SingletonMain {

	public static void main(String[] args) {
		new Thread(() -> {
			LazySingleton lazySingleton = LazySingleton.getInstance();
			System.out.println(lazySingleton);
			lazySingleton.singleton();
		}).start();

		new Thread(() -> {
			LazySingleton lazySingleton = LazySingleton.getInstance();
			System.out.println(lazySingleton);
			lazySingleton.singleton();
		}).start();

		new Thread(() -> {
			LazySingleton lazySingleton = LazySingleton.getInstance();
			System.out.println(lazySingleton);
			lazySingleton.singleton();
		}).start();
///////////////////////
		new Thread(() -> {
			HungrySingleton hungrySingleton = HungrySingleton.getInstance();
			System.out.println(hungrySingleton);
			hungrySingleton.singleton();
		}).start();

		new Thread(() -> {
			HungrySingleton hungrySingleton = HungrySingleton.getInstance();
			System.out.println(hungrySingleton);
			hungrySingleton.singleton();
		}).start();

		new Thread(() -> {
			HungrySingleton hungrySingleton = HungrySingleton.getInstance();
			System.out.println(hungrySingleton);
			hungrySingleton.singleton();
		}).start();
///////////////////////
		new Thread(() -> {
			StaticSingleton staticSingleton = StaticSingleton.getInstance();
			System.out.println(staticSingleton);
			staticSingleton.singleton();
		}).start();

		new Thread(() -> {
			StaticSingleton staticSingleton = StaticSingleton.getInstance();
			System.out.println(staticSingleton);
			staticSingleton.singleton();
		}).start();

		new Thread(() -> {
			StaticSingleton staticSingleton = StaticSingleton.getInstance();
			System.out.println(staticSingleton);
			staticSingleton.singleton();
		}).start();
///////////////////////
		new Thread(() -> {
			EnumSingleton enumSingleton = EnumSingleton.EnumSingleton;
			System.out.println(enumSingleton);
			enumSingleton.singleton();
		}).start();

		new Thread(() -> {
			EnumSingleton enumSingleton = EnumSingleton.EnumSingleton;
			System.out.println(enumSingleton);
			enumSingleton.singleton();
		}).start();

		new Thread(() -> {
			EnumSingleton enumSingleton = EnumSingleton.EnumSingleton;
			System.out.println(enumSingleton);
			enumSingleton.singleton();
		}).start();
	}

}
